/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.com.peluq.model.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Diego_M
 */
@Entity
@Table(name = "fondo_fijo", catalog = "peludb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FondoFijo.findAll", query = "SELECT f FROM FondoFijo f"),
    @NamedQuery(name = "FondoFijo.findByIdfondoFijo", query = "SELECT f FROM FondoFijo f WHERE f.idfondoFijo = :idfondoFijo"),
    @NamedQuery(name = "FondoFijo.findByDescri", query = "SELECT f FROM FondoFijo f WHERE f.descri = :descri")})
public class FondoFijo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idfondo_fijo", nullable = false)
    private Integer idfondoFijo;
    @Size(max = 40)
    @Column(name = "descri", length = 40)
    private String descri;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "fondoFijo")
    private RendicionFijo rendicionFijo;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "fondoFijo")
    private Collection<CtaPagarFijo> ctaPagarFijoCollection;

    public FondoFijo() {
    }

    public FondoFijo(Integer idfondoFijo) {
        this.idfondoFijo = idfondoFijo;
    }

    public Integer getIdfondoFijo() {
        return idfondoFijo;
    }

    public void setIdfondoFijo(Integer idfondoFijo) {
        this.idfondoFijo = idfondoFijo;
    }

    public String getDescri() {
        return descri;
    }

    public void setDescri(String descri) {
        this.descri = descri;
    }

    public RendicionFijo getRendicionFijo() {
        return rendicionFijo;
    }

    public void setRendicionFijo(RendicionFijo rendicionFijo) {
        this.rendicionFijo = rendicionFijo;
    }

    @XmlTransient
    public Collection<CtaPagarFijo> getCtaPagarFijoCollection() {
        return ctaPagarFijoCollection;
    }

    public void setCtaPagarFijoCollection(Collection<CtaPagarFijo> ctaPagarFijoCollection) {
        this.ctaPagarFijoCollection = ctaPagarFijoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idfondoFijo != null ? idfondoFijo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FondoFijo)) {
            return false;
        }
        FondoFijo other = (FondoFijo) object;
        if ((this.idfondoFijo == null && other.idfondoFijo != null) || (this.idfondoFijo != null && !this.idfondoFijo.equals(other.idfondoFijo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.peluq.model.entity.FondoFijo[ idfondoFijo=" + idfondoFijo + " ]";
    }
    
}
